home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crosscountry USA Photo Safari
/
Crosscountry USA Photo Safari.iso
/
Data
/
cc_base
/
pak00_16bit_f.pk3
/
laptop.gl.p
< prev
next >
Wrap
Text File
|
2003-01-02
|
12KB
|
360 lines
{
ScriptID = script {
@setup {
ResByName("dispatch.gl");
ResByName("map.gl");
ResByName("country_map.gl");
ResByName("expense.gl");
ResByName("photo_album.gl");
ResByName("travel_log.gl");
ResByName("help.gl");
ResByName("eat.tab");
ResByName("fuel.tab");
ResByName("load.tab");
ResByName("maintenance.tab");
ResByName("postcard.tab");
ResByName("system.tab");
ResByName("timezone.tab");
ResByName("sleep.tab");
ResByName("dash.gl");
ResByName("cell_phone.gl");
ResByName("switch_player.gl");
}
@show {
ResParseEvent(ResByName("laptop.gl/switch_player_layer"),"@update");
}
};
ChildID = {
GuiLaptopController("laptop_controller") {
ScriptID = script {
@animate {
resid sound;
resid panel_to_display;
resid panel_being_displayed;
int hide_all;
sound = ResByName("sound/button_click.wav");
ResPropAlias(SELF, "panel_to_display", "panel_to_display");
ResPropAlias(SELF, "panel_being_displayed", "panel_being_displayed");
ResPropAlias(SELF, "hide_all", "hide_all");
if (! ResValid(panel_being_displayed) ) {
/* Log(LOG_DEBUG,"setting tab to dispatch\n"); */
panel_being_displayed = RES_INVALID;
panel_to_display = ResByName("dispatch.gl");
ResPRopSetResID(GuiSiblingByName("dispatch"),"RadioGroupSelectedID",GuiSiblingByName("dispatch"));
}
if (panel_to_display != panel_being_displayed) {
AudioPlay( sound );
if (ResValid(panel_being_displayed)) {
ResPropSetInt(panel_being_displayed, "Hidden", TRUE);
}
ResPropSetInt(panel_to_display, "Hidden", FALSE);
panel_being_displayed = panel_to_display;
}
/* Um, this is done every frame? probably shouldn't be */
if (hide_all == 1) {
ResPropSetInt(panel_being_displayed, "Hidden", TRUE);
ResPropSetInt(ResByName("laptop.gl"), "Hidden", TRUE);
ResPropSetInt(ResByName("dash.gl"), "Hidden", FALSE);
ResPropSetInt(ResByName("eat.tab"), "Hidden", FALSE);
ResPropSetInt(ResByName("fuel.tab"), "Hidden", FALSE);
ResPropSetInt(ResByName("load.tab"), "Hidden", FALSE);
ResPropSetInt(ResByName("maintenance.tab"), "Hidden", FALSE);
ResPropSetInt(ResByName("postcard.tab"), "Hidden", FALSE);
ResPropSetInt(ResByName("system.tab"), "Hidden", FALSE);
ResPropSetInt(ResByName("timezone.tab"), "Hidden", FALSE);
ResPropSetInt(ResByName("sleep.tab"), "Hidden", FALSE);
} else {
ResPropSetInt(panel_being_displayed, "Hidden", FALSE);
ResPropSetInt(ResByName("laptop.gl"), "Hidden", FALSE);
ResPropSetInt(ResByName("dash.gl"), "Hidden", TRUE);
ResPropSetInt(ResByName("eat.tab"), "Hidden", TRUE);
ResPropSetInt(ResByName("fuel.tab"), "Hidden", TRUE);
ResPropSetInt(ResByName("load.tab"), "Hidden", TRUE);
ResPropSetInt(ResByName("maintenance.tab"), "Hidden", TRUE);
ResPropSetInt(ResByName("postcard.tab"), "Hidden", TRUE);
ResPropSetInt(ResByName("system.tab"), "Hidden", TRUE);
ResPropSetInt(ResByName("timezone.tab"), "Hidden", TRUE);
ResPropSetInt(ResByName("sleep.tab"), "Hidden", TRUE);
}
}
}
},
GuiButtonGroup("map") {
X = 25;
Y = 14;
AutoSize = HEIGHT;
AutoSize = WIDTH;
RadioGroupID = 1;
ScriptID = Script {
@activate {
ResPropSetResID(ResByName("laptop.gl/laptop_controller"),"panel_to_display", ResByName("map.gl"));
}
};
ChildID = {
GuiButton("map_off") {
UpID = "gui/laptop/laptop_tab/map_off.pcx";
},
GuiButton("map_on") {
UpID = "gui/laptop/laptop_tab/map_on.pcx";
}
};
},
GuiButtonGroup("country_map") {
X = 75;
Y = 14;
AutoSize = HEIGHT;
AutoSize = WIDTH;
RadioGroupID = 1;
ScriptID = Script {
@activate {
ResPropSetResID(ResByName("laptop.gl/laptop_controller"),"panel_to_display", ResByName("country_map.gl"));
}
};
ChildID = {
GuiButton("map_off") {
UpID = "gui/laptop/laptop_tab/country_map_off.pcx";
},
GuiButton("map_on") {
UpID = "gui/laptop/laptop_tab/country_map_on.pcx";
}
};
},
GuiButtonGroup("dispatch") {
X = 125;
Y = 14;
AutoSize = HEIGHT;
AutoSize = WIDTH;
RadioGroupID = 1;
ScriptID = Script {
@activate {
/* Log(LOG_DEBUG,"dispatch tab set\n"); */
ResPropSetResID(ResByName("laptop.gl/laptop_controller"),"panel_to_display", ResByName("dispatch.gl"));
}
};
ChildID = {
GuiButton("dispatch_off") {
UpID = "gui/laptop/laptop_tab/dispatch_off.pcx";
},
GuiButton("dispatch_on") {
UpID = "gui/laptop/laptop_tab/dispatch_on.pcx";
}
};
},
GuiButtonGroup("expenses") {
X = 175;
Y = 14;
AutoSize = HEIGHT;
AutoSize = WIDTH;
RadioGroupID = 1;
ScriptID = Script {
@activate {
ResPropSetResID(ResByName("laptop.gl/laptop_controller"),"panel_to_display", ResByName("expense.gl"));
}
};
ChildID = {
GuiButton("expenses_off") {
UpID = "gui/laptop/laptop_tab/expenses_off.pcx";
},
GuiButton("expenses_on") {
UpID = "gui/laptop/laptop_tab/expenses_on.pcx";
}
};
},
GuiButtonGroup("photos") {
X = 225;
Y = 14;
AutoSize = HEIGHT;
AutoSize = WIDTH;
RadioGroupID = 1;
ScriptID = Script {
@activate {
ResPropSetResID(ResByName("laptop.gl/laptop_controller"),"panel_to_display", ResByName("photo_album.gl"));
}
};
ChildID = {
GuiButton("photos_off") {
UpID = "gui/laptop/laptop_tab/photo_album_off.pcx";
},
GuiButton("photos_on") {
UpID = "gui/laptop/laptop_tab/photo_album_on.pcx";
}
};
},
GuiButtonGroup("log") {
X = 275;
Y = 14;
AutoSize = HEIGHT;
AutoSize = WIDTH;
RadioGroupID = 1;
ScriptID = Script {
@activate {
ResPropSetResID(ResByName("laptop.gl/laptop_controller"),"panel_to_display", ResByName("travel_log.gl"));
}
};
ChildID = {
GuiButton("log_off") {
UpID = "gui/laptop/laptop_tab/travel_log_off.pcx";
},
GuiButton("log_on") {
UpID = "gui/laptop/laptop_tab/travel_log_on.pcx";
}
};
},
GuiButtonGroup("help") {
X = 325;
Y = 14;
AutoSize = HEIGHT;
AutoSize = WIDTH;
RadioGroupID = 1;
ScriptID = Script {
@activate {
ResPropSetResID(ResByName("laptop.gl/laptop_controller"),"panel_to_display", ResByName("help.gl"));
}
};
ChildID = {
GuiButton("help_off") {
UpID = "gui/laptop/laptop_tab/help_off.pcx";
},
GuiButton("help_on") {
UpID = "gui/laptop/laptop_tab/help_on.pcx";
}
};
},
GuiButton("dash") {
X = 560;
Y = 14;
AutoSize = HEIGHT;
AutoSize = WIDTH;
StyleID = "gui/bs/dash.gbs";
ScriptID = Script {
@activate {
resid mc;
mc = ResByName("laptop.gl/laptop_controller");
ResPropSetInt(mc,"hide_all", 1);
ResPropSetInt(ResByName("dash.gl"),"Hidden",FALSE);
release("laptop");
release("laptop_photo");
release("laptop_new_city");
}
};
},
GuiLayer("switch_player_layer") {
X = 490;
Y = 14;
ScriptID = Script {
@loaded {
ResParseEvent(SELF, "@update");
}
@show {
ResParseEvent(SELF, "@update");
}
@update {
resid Game;
resid Player;
resid city_data_id;
int nav_truck_x;
int nav_truck_y;
int city_x;
int city_y;
int nav_cur_city_row_num;
Game = ResByName("Game");
if (ResPropGetInt(Game, "game_num_players") == 1) {
ResPropSetInt(SELF, "Hidden", TRUE);
} else {
/* get player nav truck and nav city info */
Player = ResPropGetResID(Game,"game_cur_player");
nav_truck_x = ResPropGetInt(Player, "nav_truck_x");
nav_truck_y = ResPropGetInt(Player, "nav_truck_y");
nav_cur_city_row_num = ResPropGetInt(Player, "nav_cur_city_row_num");
city_data_id = ResPropGetResID(ResByName("CSVData"), "city_id");
city_x = CSVGetInt(city_data_id, "x", nav_cur_city_row_num);
city_y = CSVGetInt(city_data_id, "y", nav_cur_city_row_num);
if (!((city_x == nav_truck_x) && (city_y == nav_truck_y))) {
ResPropSetInt(GuiChildByName(SELF, "switch_player"), "Hidden", TRUE);
ResPropSetInt(GuiChildByName(SELF, "switch_player_dis"), "Hidden", FALSE);
if (ResPropGetResID(Game, "game_cur_player") == ResPropGetResID(Game, "player_1_id")) {
ResPropSetResID(GuiChildByName(SELF, "switch_player_dis"), "AnimationID", ResByName("gui/laptop/laptop_tab/switch2_player2_dis.pcx"));
} else {
ResPropSetResID(GuiChildByName(SELF, "switch_player_dis"), "AnimationID", ResByName("gui/laptop/laptop_tab/switch2_player1_dis.pcx"));
}
} else {
ResPropSetInt(GuiChildByName(SELF, "switch_player"), "Hidden", FALSE);
ResPropSetInt(GuiChildByName(SELF, "switch_player_dis"), "Hidden", TRUE);
}
}
}
};
ChildID = {
GuiAnimation("switch_player_dis") {
X = 0;
Y = 0;
Hidden = TRUE;
ScriptID = Script {
@loaded {
ResByName("gui/laptop/laptop_tab/switch2_player2_dis.pcx");
ResByName("gui/laptop/laptop_tab/switch2_player1_dis.pcx");
}
};
},
GuiButton("switch_player") {
X = 0;
Y = 0;
AutoSize = HEIGHT;
AutoSize = WIDTH;
StyleID = "gui/bs/switch2_player2.gbs";
ScriptID = Script {
@loaded {
ResByName("gui/bs/switch2_player2.gbs");
ResByName("gui/bs/switch2_player1.gbs");
}
@update {
resid Game;
Game = ResByName("Game");
if (ResPropGetResID(Game, "game_cur_player") == ResPropGetResID(Game, "player_1_id")) {
ResPropSetResID(SELF, "StyleID", ResByName("gui/bs/switch2_player2.gbs"));
} else {
ResPropSetResID(SELF, "StyleID", ResByName("gui/bs/switch2_player1.gbs"));
}
}
@loaded {
ResParseEvent(SELF, "@update");
}
@activate {
ResParseEvent(ResByName("common/switch_player.c4"),"@switch_player");
ResParseEvent(SELF, "@update");
}
};
}
}; /* END OF switch_player CHILDID */
} /* END OF switch_player */
};
}